Repository navigation
fix(typescript-nestjs-server): peerDependencies typo and lost model name on primitive-union request bodies - #25708
Merged
wing328 merged 2 commits intoNov 17, 2026
Conversation
The template wrote "peeerDependencies", which npm ignores, so the generated package declared no peer dependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t object members
A named oneOf/anyOf body with only primitive members has no vars, so
addBodyModelSchema fell through to the inline-union branch. With
TypeScript generators this replaced the model name with the union type
string ("number | string") in dataType, baseType, paramName and imports,
e.g. typescript-nestjs-server emitted
`import { number | string } from '../models'`.
Only take the inline-union branch when there is no named model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
thanks for the fix, which has been merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25709
Fixes #25710
Two fixes found while using
typescript-nestjs-server.1.
package.mustachetypo. The template writes"peeerDependencies", which npm ignores, so the generated package declares no peer dependencies. Now"peerDependencies". (Only generated whennpmNameis set, so no sample changes.)2. Named
oneOf/anyOfrequest bodies without object members lose their model name. Repro:NodeIdhas no vars, soDefaultCodegen.addBodyModelSchemafalls into the branch for inline unions (complexTypecontains" | "). For TypeScript generators the body'sdataType,baseType,paramNameand import then becomenumber | string/numberString, andtypescript-nestjs-serveremitsimport { number | string } from '../models'. Same withanyOf.The fix only takes that branch when there is no named model, so a named union falls through to the existing branch that already uses
codegenModel.classname(what non-TypeScript generators get today). Inline unions are unchanged. AddedDefaultCodegenTest#referencedPrimitiveUnionBodyKeepsModelName(fails before, passes after).DefaultCodegenTestand the TypeScript generator tests pass. Regenerating all samples gives no diff.PR checklist
TypeScript technical committee: @TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov @davidgamero @mkusaka @joscha @KannaKim @thekhegay
🤖 Generated with Claude Code